package com.dd.test;

public class UpperClass {
	private int i =0;
	private int j =1;
	
	public static String p_i="p_i";
	
	public static String p_j="p_j";
	
	public static class StaticInnerClass {
		int i =1;
		public String getValueOfPI(){
		   
			return p_i;
		}
		
		public String getValueOfPJ(){
			return p_j;
		}
		
	}

	public class InnerClass {
		
		public int getValueOfI(){
			
			return i;
		}
		
		public int getValueOfJ(){
			return j;
		}
	}

	public static void main(String[] args) {
	        // works
	        StaticInnerClass stat = new StaticInnerClass();
	        // doesn't compile
	        UpperClass uc = new UpperClass();
	        
	        InnerClass ic = uc.new InnerClass();
	        
	        System.out.println("InnerClass acess the i in UpperClass:"+ic.getValueOfI());
	        System.out.println("InnerClass acess the j in UpperClass:"+ic.getValueOfJ());
	        
	        System.out.println("Static InnerClass acess the p_i in UpperClass:"+stat.getValueOfPI());
	        System.out.println("Static InnerClass acess the p_j in UpperClass:"+stat.getValueOfPJ());
	}
}
